# 5.1
from decimal import Decimal
from random import randint, randrange, uniform, random, choice

anInt = 1
del anInt
# 5.2
anInt = 0o101
print(anInt)
anInt = -0x92
print(anInt)
anInt = 0xDECADEBACDEF
print(anInt)
print(2 << 100)
# 5.3
print(4.3e5 + 100)
# 5.4
aComplex = -8.333 + 0j
print(aComplex)
print(aComplex.real, aComplex.imag, aComplex.conjugate())

# 5.5
print(1 + 4.5)
print(1 / 2, 3 // 2)
print(-3 ** 2, 4.0 ** -1.0)
print(4 ** -1)
print(8 / 3)
print(8 % 5)

# 5.6
print(str(123))
print(float(123), int(123.4), complex(12), bool(12))
print(divmod(10, 3))
print(pow(2, 5, 6))
print(round(2.3353, 2))
print(-0.5 // 1, round(-0.5), round(-1.5), -1.5 // 1)

print(hex(255), oct(255))
print(ord('a'), chr(65))

# 5.7
print(bool((1,)))
# 不再可以
# True, False = False, True
print(0.1)
print(1.2 + float(Decimal('.1')))

# 5.8 高级数字科学技术 NumPy 和 SciPy
print(randint(2, 10), uniform(2, 10))
print(randrange(1, 100, 2))
print(random(), choice('123456789'))
